
<div align="center"></div>
<div class="JO_left">



	



	<!-- Form -->
<div
			class	= "JO_bar_720"
		>

											

			<h1><?= empty( $_REQUEST[ "SO_content_key" ] ) ? "Insert" : "Update" ?> a Content</h1>

			<div>
 				<span id="load_contend" > 
					loadding...
               </span>
	    </div>
		</div>
</div>
<div align="justify"> </div>
<div align="justify"> </div>
<script>

function showobj(url,obj) {
    document.getElementById(obj).innerHTML="<div style=\"height: 45px;text-align: center;width:100%;background: url(JO_80_image/loading4.gif) center no-repeat\"><br/>Loadding...</div>";
    if (window.XMLHttpRequest) {
    xmlhttp=new XMLHttpRequest(); }
    else {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
        xmlhttp.onreadystatechange=function() {
                if (xmlhttp.readyState==4 && xmlhttp.status==200) {
                    document.getElementById(obj).innerHTML=xmlhttp.responseText;
                }
           };
    xmlhttp.open("GET",url,true);
    xmlhttp.send();
}

function searchKeyPress(e,f)
    {
        // look for window.event in case event isn't passed in
        if (window.event) { e = window.event; }
        if (e.keyCode == 13)
        {
			var sea=escape(_utf8_encode($('#txt_id').val()));
			var sea2=escape(_utf8_encode($('#txt_sub').val()));
			var sea3=escape(_utf8_encode($('#txt_sub18').val()));
			var sea4=escape(_utf8_encode($('#txt_bugs').val()));
			
			
			if(sea!='')
                var url="JO_71_SO/SO_17_01_managing_genre.php?SO_sea="+sea+"&SO_cot="+f+"&SO_tim=a";
			if(sea2!='')
                var url="JO_71_SO/SO_17_01_managing_genre.php?SO_sea2="+sea2+"&SO_cot="+f+"&SO_tim=a";
			if(sea3!='')
                var url="JO_71_SO/SO_17_01_managing_genre.php?SO_sea3="+sea3+"&SO_cot="+f+"&SO_tim=a";
			if(sea4!='')
                var url="JO_71_SO/SO_17_01_managing_genre.php?SO_sea4="+sea4+"&SO_cot="+f+"&SO_tim=a";
			if(sea=='' && sea2=='' &&sea3=='' &&sea4==''){
			var url="JO_71_SO/SO_17_01_managing_genre.php?SO_cot="+f;}	
				//showobj(url,'load_contend');
				
				
				$("#load_contend").load(url,10000,function(){
					initbtnedit()
					initbtnadd()
				});
        }
    }

	function initbtnedit(){
		$(".btnedit").click(
				function (){
					if($("#tbp").length){
						$("#tbp").remove();
					}
					if($("#tmp").length){
						$("#tmp").remove();
					}
					var id=$($(this.parentNode).children("td:first")).html();
					$(this.parentNode).after("<tr ><td colspan=5 id=\"tmp\" style=\"padding:0 !important\">asdasd</td></tr>");
					var url="JO_71_SO/SO_17_02_managing_genre.php?SO_chude="+id;
					showobj(url,'tmp');
					
					
				}
			);
	}
	function initbtnadd(){
		$(".btnadd").click(
				function (){
					if($("#tmp").length){
						$("#tmp").remove();
					}
					if($("#tbp").length){
						$("#tbp").remove();
					}
					$(this.parentNode).after("<tr ><td colspan=6 id=\"tbp\" style=\"padding:0 !important\">asdasd</td></tr>");
					var url="JO_71_SO/SO_17_02_managing_genre.php";
					showobj(url,'tbp');
					
				}
			);
	}
$().ready(
	function(){
		var url="JO_71_SO/SO_17_01_managing_genre.php";
		$("#load_contend").load(url,10000,function(){
			initbtnedit()
			initbtnadd()
		});
	}
);

</script>
